poem = ["\t\n1234",
        "123",
        "12345\t\n",
        "12345",
        "12345",
        "12345"   ]

for poem_str in poem:
    # 先使用strip方法去除字符串中空白字符,再进行对齐
    print("|%s|" % poem_str.strip().center(10," "))
    # print("|%s|" % poem_str.center(10," "))
    # print("|%s|" % poem_str.rjust(10," "))
    # print("|%s|" % poem_str.ljust(10," "))
